package com.xiaotao.controller;

import com.xiaotao.service.WalletService;
import com.xiaotao.util.ResponseUtil;
import com.xiaotao.util.UserUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/wallet")
public class WalletController {
    @Resource
    private WalletService walletService;

    @GetMapping
    public ResponseUtil queryByUserId() throws Exception {
        Integer userId = UserUtil.UserContext();
        return walletService.queryByUserId(userId);
    }
}
